<!--
 * @Description: In User Settings Edit
 * @Author: your name
 * @Date: 2019-10-15 21:52:37
 * @LastEditTime: 2019-10-16 09:54:07
 * @LastEditors: Please set LastEditors
 -->
<template>
  <div class = "w">
    <div class = "header curpoit">
      <p class="linetobottom" @click="goredict">实名认证</p>
      <p @click=" gosvaemon">保证金</p>
      <p @click="goejor">分成资格</p>
    </div>
    <div style = "display: flex">
      <div style = "flex: 4">
        <el-form :model = "form"
                 label-width = "100px"
                 :label-position = "'left'">
          <el-form-item label = "真实姓名">
            <el-input v-model = "form.name"></el-input>
          </el-form-item>
          <el-form-item label = "身份证号">
            <el-input v-model = "form.name"></el-input>
          </el-form-item>
          <el-form-item label = "证券营业部">
            <el-input v-model = "form.name"></el-input>
          </el-form-item>
          <el-form-item label = "证券账号">
            <el-input v-model = "form.name"></el-input>
          </el-form-item>
          <el-form-item label = "最大可投额">
            <el-input v-model = "form.name">
              <template slot = "append">万</template>
            </el-input>
          </el-form-item>
          <el-form-item label = "银行开户行">
            <el-input v-model = "form.name"></el-input>
          </el-form-item>
          <el-form-item label = "银行卡号">
            <el-input v-model = "form.name"></el-input>
          </el-form-item>
          <el-form-item label = "">
            <el-button type = "primary">申请实名验证</el-button>
          </el-form-item>
        </el-form>
      </div>
      <div style = "flex: 6 ;margin-left:200px;">
        <el-form :label-position = "'left'"
                 label-width = "100px">
          <el-form-item label = "上传身份证:">
            <el-upload class = "avatar-uploader"
                       action = "#"
                       :show-file-list = "false"
                       :on-success = "handleAvatarSuccess"
                       :before-upload = "beforeAvatarUpload"
                       :http-request = "fucker">
              <img v-if = "imageUrl"
                   :src = "imageUrl"
                   class = "avatar">
              <i v-else
                 class = "el-icon-plus avatar-uploader-icon"></i>
            </el-upload>
          </el-form-item>
          <el-form-item label = "上传证券截图:">
            <el-upload class = "avatar-uploader"
                       action = "#"
                       :show-file-list = "false"
                       :on-success = "handleAvatarSuccess"
                       :before-upload = "beforeAvatarUpload"
                       :http-request = "fucker">
              <img v-if = "imageUrl"
                   :src = "imageUrl"
                   class = "avatar">
              <i v-else
                 class = "el-icon-plus avatar-uploader-icon"></i>
            </el-upload>
          </el-form-item>
          <el-form-item label = "上传银行卡:">
            <el-upload class = "avatar-uploader"
                       action = "#"
                       :show-file-list = "false"
                       :on-success = "handleAvatarSuccess"
                       :before-upload = "beforeAvatarUpload"
                       :http-request = "fucker">
              <img v-if = "imageUrl"
                   :src = "imageUrl"
                   class = "avatar">
              <i v-else
                 class = "el-icon-plus avatar-uploader-icon"></i>
            </el-upload>
          </el-form-item>
        </el-form>
      </div>
    </div>
    <div>
      <el-steps :active = "1">
        <el-step title = "步骤1" description = "完成基本资料页并完成手机和邮箱验证"></el-step>
        <el-step title = "步骤2" description = "填写本页资料并上传三个资料图"></el-step>
        <el-step title = "步骤3" description = "等待客服审核"></el-step>
      </el-steps>
      <el-form label-width = "300px" style = "margin-top: 20px" :label-position = "'left'" :inline = "true">
        <el-form-item label = "上传本人名下证券账户最近一年交割单截图：
        要求:收益率跑赢上证大盘指数，且年收益率不低于50%，客服审批后获得发布分成代炒股资格有效期一年">
          <el-upload class = "avatar-uploader"
                     action = "#"
                     :show-file-list = "false"
                     :on-success = "handleAvatarSuccess"
                     :before-upload = "beforeAvatarUpload"
                     :http-request = "fucker">
            <img v-if = "imageUrl"
                 :src = "imageUrl"
                 class = "avatar">
            <i v-else
               class = "el-icon-plus avatar-uploader-icon"></i>
          </el-upload>
        </el-form-item>
        <el-form-item>
          <el-image
            style = "width: 110px; height: 110px"
            :src = "url"
           >
          </el-image>
        </el-form-item>
        <el-form-item>
          <el-button type = "primary" style = "margin:30px">申请炒股资格</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
    export default {
        data() {
            return {
                form: {
                    name: ''
                },
                imageUrl: '',
                url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
                srcList: [
                    'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
                    'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg'
                ]
            }
        },
        methods: {
            handleAvatarSuccess(res, file) {
                this.imageUrl = URL.createObjectURL(file.raw)
                console.log(this.imageUrl)
            },
            beforeAvatarUpload(file) {
                const isJPG = file.type === 'image/jpeg'
                const isLt2M = file.size / 1024 / 1024 < 2

                if (!isJPG) {
                    this.$message.error('上传头像图片只能是 JPG 格式!')
                }
                if (!isLt2M) {
                    this.$message.error('上传头像图片大小不能超过 2MB!')
                }
                return isJPG && isLt2M
            },
            fucker() {
                console.log('上传成功')
            },
            goredict(){
              this.$router.push({path:"/Account/Certification"})
            },
            gosvaemon(){
              this.$router.push({path:"/Account/Margin"})
            },
            goejor(){
                 this.$router.push({path:"/Account/quali"})
            }
        }
    }
</script>

<style>
  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }

  .avatar-uploader .el-upload:hover {
    border-color: #409eff;
  }

  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 110px;
    height: 110px;
    line-height: 110px;
    text-align: center;
  }

  .avatar {
    width: 110px;
    height: 110px;
    display: block;
  }
</style>
